package com.woniu.darryringmall.utils;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

@Component
public class DateConfig implements MetaObjectHandler {

    @Override
    public void insertFill(MetaObject metaObject) {

        LocalDateTime now = LocalDateTime.now();

        //设置属性值
        this.setFieldValByName("sendTime",LocalDateTime.now().toString(),metaObject);
        this.setFieldValByName("pushTime",LocalDateTime.now().toString(),metaObject);
    }

    @Override
    public void updateFill(MetaObject metaObject) {

    }
}